package com.jy.appmarket.network.resultdata;

import com.jy.app.market.idata.Doc;
import com.jy.app.market.idata.card.CardWords;
import com.jy.app.market.idata.data.PageCard;

public class HotWordsResultData extends BaseResultData{

	CardWords mCardWords;
	
	public CardWords getCardWords() {
		return mCardWords;
	}

	@Override
	public boolean parseResult(String result) {
		Doc doc = Doc.fromJson(result);
		if (doc == null) {
			return false;
		}
		setDataType(doc.getDataType());
		setStatus(doc.getStatus());
		setMessage(doc.getMessage());
		if (doc.isOk()) {
			if (doc.isType(PageCard.class)) {
				PageCard data = doc.getData();
				mCardWords = (CardWords) data.getCards().get(0);
				return true;
			}
		}
		return false;
	}

}
